<template>
    <div style="font-size: 16px;">
        <van-row style="text-align: center;">
            <van-col span="6">序号</van-col>
            <van-col span="6">答题时间</van-col>
            <van-col span="6">积分</van-col>
            <van-col span="6">抽奖情况</van-col>
        </van-row>
        <van-list v-model:loading="loading" :finished="finished" finished-text="">
            <van-row  align="center" style="text-align: center;margin-top: 10px;" v-for="(item, index) in replyList" :key="index">
            <van-col span="6">{{ index + 1 }}</van-col>
            <van-col span="6">{{ parseTime(item.endTime,'{y}-{m}-{d} {h}:{i}:{s}') }}</van-col>
            <van-col span="6">{{ item.totalPoint }}</van-col>
            <van-col span="6">{{ item.status }}</van-col>
        </van-row>
        </van-list>
        <div style="height: 100px;width: 100%;"></div>
    </div>
</template>

<script setup>
import {parseTime} from "@/api/utils/ruoyi.js"
import { ref, computed, onMounted } from 'vue';
import { showSuccessToast, showFailToast } from 'vant';
import { getSubmitListByTask } from "@/api/mine.js"
const replyList = ref([]) //{no:'1',date:"2024-03-24 09:00:01",points:"1",status:"未中奖"}
const loading = ref(false)
const finished = ref(true)

onMounted(() => {
    getList()
})

function getList(){ 
    let taskId = localStorage.getItem('taskId')
    let openId = localStorage.getItem('token')
    getSubmitListByTask(taskId,openId).then(res => {
        if (res.code == 200) {
            replyList.value = res.data
        }else{
            replyList.value = []
        }
    })
}
</script>
<style lang="less" scoped></style>